#ifndef USERAPI_H
#define USERAPI_H

#include <vector>
#include "httpget.h"
#include <QtXml>
#include "utility.h"
#include "method.h"
#include "renrenaccount.h"

using namespace std;

class UserInfo
{
public:
    class Hometown
    {
    public:
        QString country;
        QString province;
        QString city;
    };
    class WorkInfo
    {
    public:
        QString company;
        QString description;
        QString startDate;
        QString endDate;
    };
    class UnivInfo
    {
    public:
        QString name;
        unsigned long year;
        QString department;
    };
    class HSInfo
    {
    public:
        QString name;
        unsigned long year;
    };

    long uid;
    QString name;
    QString sex;     // male: true; female: false;
    QString star;
    QString zidou;
    QString vip;
    QString birthday;
    QString email_hash;
    QString tinyurl;
    QString headurl;
    QString mainurl;
    QString headURLWithLogo;
    QString tinyURLWithLogo;
    Hometown hometown;
    vector<WorkInfo> workHistory;
    vector<UnivInfo> univHistory;
    vector<HSInfo> hsHistory;
};

class UserApi
{
public:
    UserApi();
    RenRenAccount account;
    QString getLoggedInUser();
    UserInfo getUserInfo(QString uid);
    QString hasAppPermission();
    QString isAppUser();
};

#endif // USERAPI_H
